import {
  USER_LOGIN,
  USER_LOGOUT
} from './action-type';

export function userReducer(state = {
  login: false
}, action) {
  console.log('counter()', state, action);
  switch (action.type) {
    case USER_LOGIN:
      return state = {//注意return出来的数据
        login: true
      }
    case USER_LOGOUT:
      return state = {
        login: false
      }
    default:
      //初始状态
      return state;
  }
}
